package com.maxd.respository;

import com.maxd.model.UserMemberRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

public interface UserMemberRecordRepository extends JpaRepository<UserMemberRecord, Long>, JpaSpecificationExecutor<UserMemberRecord> {

    @Transactional
    @Modifying
    @Query("update UserMemberRecord r set r.status = :status where r.transId = :transId")
    Integer updateStatus(@Param("transId") String transId, @Param("status") String status);

}